WPS Office.apk(点击下载) / fse.java


package defpackage;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.GridView;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;
import cn.wps.moffice.main.cloud.drive.WPSDriveGroupEventsActivity;
import cn.wps.moffice.main.cloud.drive.WPSDriveGroupSettingActivity;
import cn.wps.moffice.main.cloud.drive.bean.DriveGroupMemberInfo;
import cn.wps.moffice.main.cloud.storage.model.GroupMemberInfo;
import cn.wps.moffice_eng.R;
import defpackage.fjf;
import defpackage.khi;
import java.util.ArrayList;
import java.util.List;

/* renamed from: fse  reason: default package */
public final class fse implements View.OnClickListener, AdapterView.OnItemLongClickListener, fys {
    private GridView cAE;
    public String cL;
    public boolean fJO = false;
    public List<GroupMemberInfo> fzl;
    private volatile String gqe;
    public int gqf;
    public fsh gqg;
    private View gqh;
    public View gqi;
    public TextView gqj;
    public TextView gqk;
    private final int gql = 5;
    private final int gqm = 8;
    private final int gqn = 6;
    private final int gqo = 8;
    private int gqp = 5;
    public boolean gqq = false;
    public boolean gqr = false;
    public View gqs;
    public View gqt;
    public View gqu;
    public View gqv;
    public Activity mActivity;
    public String mGroupId;
    public ListView mListView;
    public View mRootView;

    public fse(Activity activity, boolean z) {
        this.mActivity = activity;
        this.fJO = z;
        if (!this.fJO) {
            this.mRootView = LayoutInflater.from(this.mActivity).inflate(R.layout.phone_home_clouddocs_group_new_setting, (ViewGroup) null);
            this.cAE = (GridView) this.mRootView.findViewById(R.id.group_member_list_layout);
            this.gqg = new fsh(this.mActivity, true);
            this.gqi = this.mRootView.findViewById(R.id.group_member_name_layout);
            this.gqi.setOnClickListener(this);
            this.gqj = (TextView) this.mRootView.findViewById(R.id.member_num);
            this.gqj.setVisibility(this.gqf < 2 ? 8 : 0);
            this.mRootView.findViewById(R.id.group_member_event_btn).setOnClickListener(this);
            this.mRootView.findViewById(R.id.phone_home_clouddocs_team_guid_url).setOnClickListener(this);
            this.gqs = this.mRootView.findViewById(R.id.group_operation_divide_bar);
            this.gqt = this.mRootView.findViewById(R.id.group_bottom_divide_line);
            this.gqu = this.mRootView.findViewById(R.id.phone_home_clouddocs_delete_group);
            this.gqu.setOnClickListener(this);
            this.gqv = this.mRootView.findViewById(R.id.phone_home_clouddocs_exit_group);
            this.gqv.setOnClickListener(this);
            this.cAE.setAdapter((ListAdapter) this.gqg);
            this.cAE.setOnItemClickListener(new AdapterView.OnItemClickListener() {
                /* class defpackage.fse.AnonymousClass1 */

                @Override // android.widget.AdapterView.OnItemClickListener
                public final void onItemClick(AdapterView<?> adapterView, View view, int i, long j) {
                    GroupMemberInfo groupMemberInfo;
                    if (fse.this.gqg != null && (groupMemberInfo = (GroupMemberInfo) fse.this.gqg.getItem(i)) != null && "add_id".equals(groupMemberInfo.id)) {
                        View view2 = new View(fse.this.mActivity);
                        view2.setId(R.id.group_member_add_btn);
                        fse.this.onClick(view2);
                    }
                }
            });
            return;
        }
        this.mRootView = LayoutInflater.from(this.mActivity).inflate(R.layout.phone_home_clouddocs_group_member_list, (ViewGroup) null);
        this.mListView = (ListView) this.mRootView.findViewById(R.id.group_member_list_layout);
        this.gqg = new fsh(this.mActivity, false);
        this.gqh = this.mRootView.findViewById(R.id.group_member_add_btn);
        this.gqh.setOnClickListener(this);
        this.mListView.setAdapter((ListAdapter) this.gqg);
        this.mListView.setOnItemLongClickListener(this);
        fhm.hv("public_wpscloud_group_all_members_show");
    }

    /* access modifiers changed from: private */
    /* access modifiers changed from: public */
    private boolean bFL() {
        if (fim.cC(this.mActivity)) {
            return false;
        }
        fno bBh = fok.bBq().geJ.bBh();
        return (this.gqg == null || bBh == null || bBh.gcB == null || bBh.gcB.gbu == null || ((long) this.gqf) < bBh.gcB.gbu.gbz || fkc.N(40)) ? false : true;
    }

    private int mc(boolean z) {
        return luf.gR(this.mActivity) ? z ? 6 : 8 : z ? 5 : 8;
    }

    @Override // defpackage.fys
    public final View getMainView() {
        return this.mRootView;
    }

    @Override // defpackage.fys
    public final String getViewTitle() {
        return this.mActivity.getString(this.fJO ? R.string.phone_home_clouddocs_role_member : R.string.public_grouoinfo);
    }

    public final void mb(boolean z) {
        List<GroupMemberInfo> subList;
        boolean z2 = true;
        int i = 0;
        if (!this.fJO) {
            this.gqp = mc(z);
            if (this.cAE != null) {
                this.cAE.setNumColumns(this.gqp);
            }
            if (!(this.gqg == null || this.fzl == null)) {
                List<GroupMemberInfo> list = this.fzl;
                if (list == null) {
                    subList = null;
                } else {
                    if (this.mActivity.getResources().getConfiguration().orientation != 1) {
                        z2 = false;
                    }
                    int mc = mc(z2);
                    if (this.gqq) {
                        mc--;
                    }
                    subList = list.size() <= mc ? list : list.subList(0, mc);
                }
                if (subList != null && subList.size() > 0) {
                    ArrayList arrayList = new ArrayList(subList);
                    if (this.gqq) {
                        GroupMemberInfo groupMemberInfo = new GroupMemberInfo();
                        groupMemberInfo.id = "add_id";
                        groupMemberInfo.memberName = "";
                        arrayList.add(groupMemberInfo);
                    }
                    this.gqg.setData(arrayList);
                }
                this.gqg.notifyDataSetChanged();
            }
            if (this.gqj != null) {
                TextView textView = this.gqj;
                if (this.gqf < 2) {
                    i = 8;
                }
                textView.setVisibility(i);
            }
        }
    }

    public void md(boolean z) {
        if (this.gqh != null) {
            this.gqh.setVisibility(z ? 0 : 8);
        }
    }

    public final void onClick(View view) {
        if (view != null) {
            int id = view.getId();
            if (id == R.id.group_member_add_btn) {
                dwp.lV("public_invite_member");
                final String str = this.fJO ? "member" : "information";
                final fno bBh = fok.bBq().geJ.bBh();
                if (this.gqe == null || bBh == null) {
                    lvg.d(this.mActivity, R.string.phone_home_clouddocs_team_setting_unable_invite_member, 0);
                } else if (!luf.gQ(this.mActivity)) {
                    kha.a((Context) this.mActivity, this.gqe, (khi.a) null, false, bBh.userName, this.cL, str).show();
                } else if (bBh != null && bBh.gcB == null && !bBh.gco) {
                    fok.bBq().d(new foi<fno>() {
                        /* class defpackage.fse.AnonymousClass3 */

                        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
                        @Override // defpackage.foi, defpackage.foh
                        public final /* synthetic */ void s(fno fno) {
                            final fno fno2 = fno;
                            if (fno2 != null) {
                                if (fse.this.bFL()) {
                                    fcz.b(new Runnable() {
                                        /* class defpackage.fse.AnonymousClass3.AnonymousClass1 */

                                        public final void run() {
                                            fim.g(fse.this.mActivity, new Runnable() {
                                                /* class defpackage.fse.AnonymousClass3.AnonymousClass1.AnonymousClass1 */

                                                public final void run() {
                                                    kha.a((Context) fse.this.mActivity, fse.this.gqe, (khi.a) null, false, fno2.userName, fse.this.cL, str).show();
                                                }
                                            });
                                        }
                                    }, false);
                                } else {
                                    kha.a((Context) fse.this.mActivity, fse.this.gqe, (khi.a) null, false, fno2.userName, fse.this.cL, str).show();
                                }
                            }
                        }
                    });
                } else if (bFL()) {
                    fim.g(this.mActivity, new Runnable() {
                        /* class defpackage.fse.AnonymousClass4 */

                        public final void run() {
                            kha.a((Context) fse.this.mActivity, fse.this.gqe, (khi.a) null, false, bBh.userName, fse.this.cL, str).show();
                        }
                    });
                } else {
                    kha.a((Context) this.mActivity, this.gqe, (khi.a) null, false, bBh.userName, this.cL, str).show();
                }
            } else if (id == R.id.group_member_name_layout) {
                if (this.gqr) {
                    fhm.hv("public_wpscloud_group_rename_click");
                    fjf.a(this.mActivity, this.mGroupId, this.cL, new fjf.a() {
                        /* class defpackage.fse.AnonymousClass5 */

                        @Override // defpackage.fjf.a
                        public final void qQ(final String str) {
                            fse.this.cL = str;
                            fse.this.gqk.post(new Runnable() {
                                /* class defpackage.fse.AnonymousClass5.AnonymousClass1 */

                                public final void run() {
                                    fhm.hv("public_wpscloud_group_rename_success");
                                    Intent intent = new Intent();
                                    intent.putExtra("GROUP_SETTING_RENAME_GROUP", str);
                                    fse.this.mActivity.setResult(-1, intent);
                                    fse.this.gqk.setText(str);
                                }
                            });
                        }
                    });
                }
            } else if (id == R.id.member_num) {
                Intent intent = new Intent(this.mActivity, WPSDriveGroupSettingActivity.class);
                intent.putExtra("intent_group_setting_groupid", this.mGroupId);
                intent.putExtra("intent_group_setting_groupname", this.cL);
                intent.putExtra("intent_group_setting_group_member_num", (long) this.gqf);
                intent.putExtra("intent_new_group", false);
                intent.putExtra("intent_group_setting_type", "intent_group_setting_type_view_list");
                this.mActivity.startActivity(intent);
                fhm.qf("public_wpscloud_group_all_members");
            } else if (id == R.id.group_member_event_btn) {
                fhm.hu("public_wpscloud_collaboration");
                Intent intent2 = new Intent(this.mActivity, WPSDriveGroupEventsActivity.class);
                intent2.putExtra("intent_group_event_url", this.mActivity.getString(R.string.home_clouddocs_group_events_url) + this.mGroupId);
                this.mActivity.startActivity(intent2);
            } else if (id == R.id.phone_home_clouddocs_team_guid_url) {
                try {
                    fhm.hv("public_wpscloud_group_setting_link_click");
                    this.mActivity.startActivity(new Intent("android.intent.action.VIEW", Uri.parse("https://drive.wps.cn")));
                } catch (Exception e) {
                    e.printStackTrace();
                }
            } else if (id == R.id.phone_home_clouddocs_delete_group) {
                fhm.hv("public_wpscloud_group_delete_click");
                fsv.bGq().d(this.mActivity, this.mGroupId, this.cL);
            } else if (id == R.id.phone_home_clouddocs_exit_group) {
                fhm.hv("public_wpscloud_group_quit_click");
                fsv.bGq().p(this.mActivity, this.mGroupId);
            }
        }
    }

    @Override // android.widget.AdapterView.OnItemLongClickListener
    public final boolean onItemLongClick(AdapterView<?> adapterView, View view, int i, long j) {
        boolean z = false;
        if (!(this.gqg == null || this.fzl == null)) {
            fno bBh = fok.bBq().geJ.bBh();
            GroupMemberInfo groupMemberInfo = (GroupMemberInfo) this.gqg.getItem(i);
            if (!bBh.userId.equals(groupMemberInfo.id)) {
                String str = "";
                for (GroupMemberInfo groupMemberInfo2 : this.fzl) {
                    str = bBh.userId.equals(groupMemberInfo2.id) ? groupMemberInfo2.role : str;
                }
                boolean equals = "creator".equals(str);
                boolean z2 = "manager".equals(str) || "admin".equals(str);
                fwx a = fwv.a(fxa.gDT, new DriveGroupMemberInfo(groupMemberInfo), (String) null);
                if (z2 && "member".equals(groupMemberInfo.role)) {
                    z = true;
                }
                if (equals || z) {
                    fhm.qf("public_wpscloud_group_all_members_longpress");
                    fsv.bGq().a(this.mActivity, a, this.mGroupId, groupMemberInfo.id, new Runnable() {
                        /* class defpackage.fse.AnonymousClass6 */

                        public final void run() {
                            fsh fsh = fse.this.gqg;
                            fsh.fMP.a(fse.this.mGroupId, ((WPSDriveGroupSettingActivity) fsh.mContext).fJN, 
                            /*  JADX ERROR: Method code generation error
                                jadx.core.utils.exceptions.CodegenException: Error generate insn: 0x0019: INVOKE  
                                  (wrap: fhj : 0x000c: IGET  (r3v0 fhj) = (r1v0 'fsh' fsh) fsh.fMP fhj)
                                  (wrap: java.lang.String : 0x0008: IGET  (r2v0 java.lang.String) = (wrap: fse : 0x0006: IGET  (r0v1 fse) = (r6v0 'this' fse$6 A[IMMUTABLE_TYPE, THIS]) fse.6.gqw fse) fse.mGroupId java.lang.String)
                                  (wrap: long : 0x0012: IGET  (r4v0 long) = 
                                  (wrap: cn.wps.moffice.main.cloud.drive.WPSDriveGroupSettingActivity : 0x0010: CHECK_CAST (r0v3 cn.wps.moffice.main.cloud.drive.WPSDriveGroupSettingActivity) = (cn.wps.moffice.main.cloud.drive.WPSDriveGroupSettingActivity) (wrap: android.content.Context : 0x000e: IGET  (r0v2 android.content.Context) = (r1v0 'fsh' fsh) fsh.mContext android.content.Context))
                                 cn.wps.moffice.main.cloud.drive.WPSDriveGroupSettingActivity.fJN long)
                                  (wrap: fsh$1 : 0x0016: CONSTRUCTOR  (r0v4 fsh$1) = (r1v0 'fsh' fsh) call: fsh.1.<init>(fsh):void type: CONSTRUCTOR)
                                 type: INTERFACE call: fhj.a(java.lang.String, long, fhj$a):void in method: fse.6.run():void, file: classes.dex
                                	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:255)
                                	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:217)
                                	at jadx.core.codegen.RegionGen.makeSimpleBlock(RegionGen.java:110)
                                	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:56)
                                	at jadx.core.codegen.RegionGen.makeSimpleRegion(RegionGen.java:93)
                                	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:59)
                                	at jadx.core.codegen.MethodGen.addRegionInsns(MethodGen.java:244)
                                	at jadx.core.codegen.MethodGen.addInstructions(MethodGen.java:237)
                                	at jadx.core.codegen.ClassGen.addMethodCode(ClassGen.java:342)
                                	at jadx.core.codegen.ClassGen.addMethod(ClassGen.java:295)
                                	at jadx.core.codegen.ClassGen.lambda$addInnerClsAndMethods$2(ClassGen.java:264)
                                	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
                                	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
                                	at java.base/java.util.stream.SortedOps$RefSortingSink.end(SortedOps.java:395)
                                	at java.base/java.util.stream.Sink$ChainedReference.end(Sink.java:258)
                                Caused by: jadx.core.utils.exceptions.CodegenException: Error generate insn: 0x0016: CONSTRUCTOR  (r0v4 fsh$1) = (r1v0 'fsh' fsh) call: fsh.1.<init>(fsh):void type: CONSTRUCTOR in method: fse.6.run():void, file: classes.dex
                                	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:255)
                                	at jadx.core.codegen.InsnGen.addWrappedArg(InsnGen.java:119)
                                	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:103)
                                	at jadx.core.codegen.InsnGen.generateMethodArguments(InsnGen.java:806)
                                	at jadx.core.codegen.InsnGen.makeInvoke(InsnGen.java:746)
                                	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:367)
                                	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:249)
                                	... 14 more
                                Caused by: jadx.core.utils.exceptions.JadxRuntimeException: Expected class to be processed at this point, class: fsh, state: GENERATED_AND_UNLOADED
                                	at jadx.core.dex.nodes.ClassNode.ensureProcessed(ClassNode.java:215)
                                	at jadx.core.codegen.InsnGen.makeConstructor(InsnGen.java:630)
                                	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:363)
                                	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:230)
                                	... 20 more
                                */
                            /*
                                this = this;
                                fse r0 = defpackage.fse.this
                                fsh r1 = defpackage.fse.a(r0)
                                fse r0 = defpackage.fse.this
                                java.lang.String r2 = defpackage.fse.f(r0)
                                fhj r3 = r1.fMP
                                android.content.Context r0 = r1.mContext
                                cn.wps.moffice.main.cloud.drive.WPSDriveGroupSettingActivity r0 = (cn.wps.moffice.main.cloud.drive.WPSDriveGroupSettingActivity) r0
                                long r4 = r0.fJN
                                fsh$1 r0 = new fsh$1
                                r0.<init>()
                                r3.a(r2, r4, r0)
                                return
                            */
                            throw new UnsupportedOperationException("Method not decompiled: defpackage.fse.AnonymousClass6.run():void");
                        }
                    });
                }
            }
        }
        return true;
    }
}